package com.by.controller;

import com.by.entity.ResultBean;
import com.by.entity.Sku;
import com.by.service.SkuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 江俊俊
 * @version 1.0
 * @description
 * @date 2025/4/16 17:57
 * @since JDK1.8
 */
@RestController
@RequestMapping("/api")
@Api(tags = "商品sku信息管理")
public class SkuController extends BaseController{

    @Autowired
    SkuService skuService;

    @ApiOperation("根据spuId查询sku信息")
    @GetMapping("/sku")
    public ResultBean getSkuBySpuId(Long spuId) {

        List<Sku> skus = skuService.getSkuBySpuId(spuId);
        return success("查询sku成功",skus);
    }
}
